/**
 * Keafmd
 *
 * @ClassName: Demo2
 * @Description: Demo2
 * @author: lijl
 * @date: 2022/12/11 14:24
 * @Blog: https://keafmd.blog.csdn.net/
 */
class Book{
    private String name;
    private String author;
    private String publishing;
    private double price;
    Book(String name, String author,String publishing,double price){
        this.name = name;
        this.author = author;
        this.publishing = publishing;
        this.price = price;

    }
    Book(){
        name = "巨人";
        author = "安徒生";
        publishing = "人民出版社";
        price = 48;
    }
    void showInfo(){
        System.out.println(publishing+"出版的《"+name+"》是"+author+"写的");
        System.out.println("这本书的价格是:"+price);
    }
}
public class Demo2 {
    public static void main(String[] args) {
        Book b1 = new Book("明朝那些事儿2","当年明月","中国友谊出版公司",24.8);
        Book b2=new Book();
        b1.showInfo();
        b2.showInfo();
    }
}
